package com.client.controller;

import com.client.service.IClientService;
import com.common.entity.Client;
import com.common.untils.CommonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @create 2022-09-08
 */
@RequestMapping("/client/client")
@RestController
public class InsertClient {
    @Autowired
    private IClientService clientService;
    //注册用户
    @PostMapping("/insert/{mobile}/{qianPassword}")
    public CommonResult insertClient(@PathVariable String mobile,@PathVariable String qianPassword){
       return clientService.insertClinet(mobile,qianPassword);
    }
    //通过手机号查找个人信息
    @PostMapping("findStudentBymobile/{mobile}")
    public CommonResult findStudentBymobile(@PathVariable String mobile){
        return clientService.findStudentBymobile(mobile);
    }
    //修改个人资料
    @PostMapping("modifyStudentInformation")
    public CommonResult modifyStudentInformation(@RequestBody Client client){
        return clientService.modifyStudentInformation(client);
    }
    //修改密码
    @PostMapping("updateMemberPassword/{mobile}/{newPassword}")
    public CommonResult updateMemberPassword(@PathVariable String mobile,@PathVariable String newPassword){
        return clientService.updateMemberPassword(mobile,newPassword);
    }
}
